package com.core.life.entity;

import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.core.common.entity.BaseEntity;

/**
 * 消费类型实体类
 */
@Entity
@Table(name="t_consume_item")
public class ConsumeItemEntity extends BaseEntity{

	private static final long serialVersionUID = 1L;
	
	/** 类型名称  */
	@Column(name = "name", nullable = false,length=128,unique=true)
	private String name;

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "consumeItem")
	private Set<ConsumeRecordEntity> consumeRecords;
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public Set<ConsumeRecordEntity> getConsumeRecords() {
		return consumeRecords;
	}

	public void setConsumeRecords(Set<ConsumeRecordEntity> consumeRecords) {
		this.consumeRecords = consumeRecords;
	}
	
}
